from flask import jsonify, request, Blueprint
from database import db


# 注册蓝图
tb_goods = Blueprint('goods', __name__)


@tb_goods.route('/goods', methods=['POST', 'GET'])
def goods():
    sql = "select * from cgoods"
    tab = db.findall(sql)
    return jsonify({'code': 200, 'list': tab})
